#ifndef __FILE_H_
#define __FILE_H_

#include <FS.h>
#include "arduino.h"
#include "string.h"

#define config_file_name "/config.txt"

#define file_system_begin() 	  SPIFFS.begin()
#define file_exist(a)             SPIFFS.exists(a)
#define file_remove(a)      	  SPIFFS.remove(a)
#define config_file_exist()       SPIFFS.exists(config_file_name)
#define config_file_remove()      SPIFFS.remove(config_file_name)

typedef struct config_info
{
  char wifi_name[20];
  char wifi_pass[20];
  
  char bps[10];

  char server_ip[20];
  char  server_port[5];
  char user_name[11];
  char user_psss[11];
  char device_id[11];
  char sub_topic[12];
  char pub_topic[12];

 
}CONFIG_FILE;

extern CONFIG_FILE config_info;

extern "C" void save_file(void);

extern "C" void read_file(void);

extern "C" void print_file(void);

#endif
